const express = require('express');
const router = express.Router();

const data = [];
for(let i = 1; i < 51; i++)
    data.push({
        id: `string${i}`,
        code: `string${i}`,
        dealerCode: `string${i}`,
        dealerName: `string${i}`,
        partManager: `string${i}`,
        marketDepartmentName: `string${i}`,
        country: `string${i}`,
        partOrderTypeName: `string${i}`,
        submitDate: '2020-03-31T07:28:03.292Z',
        confirmTime: '2020-03-31T07:28:03.292Z',
        itemCount: 0,
        fobTotalAmount: 0,
        quantity: 0,
        creditAuditedTime: '2020-03-31T07:28:03.292Z',
        orderDuedate: '2020-03-31T07:28:03.292Z',
        partInvoiceCode: `string${i}`,
        shipmentDate: '2020-03-31T07:28:03.292Z',
        stockItem: `string${i}`,
        stockMoney: `string${i}`,
        stockQuantity: 0,
        itemCountInvoice: `string${i}`,
        totalAmountInvoice: `string${i}`,
        totalQuantityInvoice: `string${i}`,
        stockItemRate: 0.8,
        stockMoneyRate: 0.8,
        stockQuantityRate: 0.8,
        itemCountInvoiceRate: 0.8,
        totalAmountInvoiceRate: 0.8,
        totalQuantityInvoiceRate: 0.8,
        totalShipmentDay: 0,
        timelinessType: 1,
        orderUnmetReasonType: 1,
        abnormalExplainRate: 0.8,
        abnormalExplainTimeRate: 0.8,
    });


router.get('/', (req, res) => {
    res.json(
        {
            message: '',
            payload: {
                content: data,
                totalElements: 50,
            }
        }
    );
});
router.get('/export', (req, res) => {
    setTimeout(() => {
        res.json({
            message: '导出成功',
            payload: 'Mock导出'
        });
    }, 1000);
});

module.exports = router;
